﻿<!DOCTYPE html>
<html>

<head lang="en">
    <meta charset="UTF-8">
    <title>激活</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>

    <link rel="stylesheet" href="./AmazeUI-2.4.2/assets/css/amazeui.min.css"/>
    <link href="./css/dlstyle.css" rel="stylesheet" type="text/css">
    <script src="./AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
    <script src="./AmazeUI-2.4.2/assets/js/amazeui.min.js"></script>

    <!-- 引入vue + axios + common.js -->
    <script src="js/plugins/vue/dist/vue.js"></script>
    <script src="js/plugins/axios/dist/axios.js"></script>
    <script src="js/common.js"></script>
</head>

<body>
<div id="phoneRegister">
    <input type="submit" value="激活" @click="sure"></input>
</div>
    <script type="text/javascript">
        new Vue({
            el: "#phoneRegister",
            data:{
            },
            methods: {//方法
                sure() {
                    var url = decodeURI(window.location.href);
                    var aa = url.indexOf('=');
                    if (aa > -1) {
                        url = url.substring(aa + 1);
                        this.$http.get("/user/sure/"+url).then(res=>{
                            //成功跳转到登录页面
                            if (res.data.success){
                                location.href="login.html";
                            }else{
                                alert(res.data.message);
                            }
                        }).catch(res => {
                            alert("系统错误!")
                        });
                    }
                },
            },
            mounted(){

            }
        });
    </script>

</body>

</html>